package mc

import (
	"gitee.com/dreamwood/ez-go/db/mgo"
)

const (
	InquiryFeedbackProductEventNew           = "erp.InquiryFeedbackProductNew"
	InquiryFeedbackProductEventBeforeCreate  = "erp.InquiryFeedbackProductBeforeCreate"
	InquiryFeedbackProductEventBeforeUpdate  = "erp.InquiryFeedbackProductBeforeUpdate"
	InquiryFeedbackProductEventBeforeSave    = "erp.InquiryFeedbackProductBeforeCreate erp.InquiryFeedbackProductBeforeUpdate"
	InquiryFeedbackProductEventAfterCreate   = "erp.InquiryFeedbackProductAfterCreate"
	InquiryFeedbackProductEventAfterUpdate   = "erp.InquiryFeedbackProductAfterUpdate"
	InquiryFeedbackProductEventAfterSave     = "erp.InquiryFeedbackProductAfterCreate erp.InquiryFeedbackProductAfterUpdate"
	InquiryFeedbackProductEventDelete        = "erp.InquiryFeedbackProductDelete"
	InquiryFeedbackProductAccessControlEvent = "erp.InquiryFeedbackProductAccessControl"
)

func GetInquiryFeedbackProductConfig() *mgo.DocConfig {
	return InquiryFeedbackProduct_Config
}

var InquiryFeedbackProduct_Config *mgo.DocConfig

func init() {
	InquiryFeedbackProduct_Config = NewInquiryFeedbackProductConfig()
}
func NewInquiryFeedbackProductConfig() *mgo.DocConfig {
	return &mgo.DocConfig{
		ContainerKey: "erp.InquiryFeedbackProduct",
		Fields: []string{
			"belongTo", "src", "srcSN", "product", "num", "unit", "price", "money", "cut", "cutRate", "tax", "taxRate", "priceRef", "moneyRef", "priceConfirm", "moneyConfirm", "note", "row",
		},
		RelationFields: []string{
			"belongTo", "product", "unit", "taxRate",
		},
		RelationConfigs: map[string]*mgo.DocRelation{
			"belongTo": {
				Config:     GetInquiryFeedbackConfig,
				DocName:    "InquiryFeedback",
				JoinType:   "O",
				KeyInside:  "belongToId",
				KeyOutSide: "id",
			},
			"product": {
				Config:     GetProductConfig,
				DocName:    "Product",
				JoinType:   "O",
				KeyInside:  "productId",
				KeyOutSide: "id",
			},
			"unit": {
				Config:     GetUnitConfig,
				DocName:    "Unit",
				JoinType:   "O",
				KeyInside:  "unitId",
				KeyOutSide: "id",
			},
			"taxRate": {
				Config:     GetTaxRateConfig,
				DocName:    "TaxRate",
				JoinType:   "O",
				KeyInside:  "taxRateId",
				KeyOutSide: "id",
			},
		},
		FieldFilter: map[string]*mgo.DocFieldFilter{
			"default": {
				Select: []string{},
				Omit:   []string{},
			},
		},
	}
}
